﻿using Admin.Entity;
using Admin.UserRoles;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Admin.Repository.UserRoles
{
    public class UserRoleRepository : BaseRepository<UserRole>, IUserRoleRepository
    {
        public UserRoleRepository(MS_Context context)
        {
            db = context;
        }

        /// <summary>
        /// 查询一条数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public UserRole GetQueryId(int id)
        {
            return db.UserRoles.Include(m => m.Role).Include(x => x.UserInfo).FirstOrDefault(m => m.UserRoleId == id);
        }
    }
}
